//全局函数 ，挂载到Vue实例上
// import {url} from "@/request/http";
import { getAction, deleteAction, putAction, postAction, httpAction } from '@/api/manage'


export default function install(Vue) {


    // 文件类型，图片，音乐，文档等
    Vue.prototype.fileType = function () {
        // 是回收站类型文件
        let that = this
        return {
            // 当前文件类型
            current() {
                return that.$route.params.fileType;
            },
            isAll() {
                return that.$route.params.fileType === that.FILE_TYPE.ALL
            },
            isNotAll() {
                return that.$route.params.fileType !== that.FILE_TYPE.ALL
            },
            isRecycle() {
                return that.$route.params.fileType === that.FILE_TYPE.RECYCLE
            },
            isNotRecycle() {
                return that.$route.params.fileType !== that.FILE_TYPE.RECYCLE
            },
            isMusic() {
                return that.$route.params.fileType === that.FILE_TYPE.MUSIC
            },
            isImage() {
                return that.$route.params.fileType === that.FILE_TYPE.IMAGE
            },
            isVideo() {
                return that.$route.params.fileType === that.FILE_TYPE.VIDEO
            },
            isDoc() {
                return that.$route.params.fileType === that.FILE_TYPE.DOC
            },
            isApp() {
                return that.$route.params.fileType === that.FILE_TYPE.APP
            },
            isOther() {
                return that.$route.params.fileType === that.FILE_TYPE.OTHER
            },
            isShare() {
                return that.$route.params.fileType === that.FILE_TYPE.SHARE
            }
        }
    };

    // 文件查看模式 0列表模式 1网格模式 2 时间线模式
    Vue.prototype.fileModel = function () {
        // 是回收站类型文件
        let that = this
        return {
            current() {
                return that.$store.getters.currentFileModel
            },
            isTable() {
                return that.FILE_MODEL.TABLE === that.$store.getters.currentFileModel
            },
            isGrid() {
                return that.FILE_MODEL.GRID === that.$store.getters.currentFileModel
            },
            isTimeLine() {
                return that.FILE_MODEL.TIME_LINE === that.$store.getters.currentFileModel
            }
        }
    };

    // 文件路径，此处是id值，Long类型
    Vue.prototype.filePath = function () {
        // 是回收站类型文件
        let that = this
        return {
            // 文件查看模式 0列表模式 1网格模式 2 时间线模式
            current() {
                return that.$route.params.pid
            },
        }
    };



}
